Skip to content

Add Window Functions for use with function builder#808

Merged
andygrove merged 26 commits intoapache:mainfrom
timsaucer:feature/aggregate_and_window_builders
Sep 2, 2024
Merged

Add Window Functions for use with function builder#808
andygrove merged 26 commits intoapache:mainfrom
timsaucer:feature/aggregate_and_window_builders

Conversation

@timsaucer
Copy link
Copy Markdown
Member

@timsaucer timsaucer commented Aug 13, 2024

Which issue does this PR close?

This addresses part of #780 but we need a follow on PR to handle the aggregates.

Rationale for this change

In DataFusion 41 we have added the ability to create builders for the parameters for window and aggregate functions. These are more expressive when it comes to setting the window frame, ordering, partition, and null handling. This MR exposes this functionality on the python side.

What changes are included in this PR?

Added functions

  • lead
  • lag
  • row_number
  • rank
  • dense_rank
  • percent_rank
  • cume_dist
  • ntile

Also updated the window function page of the online documentation to include links to these, examples of how to use them, and a description of how to set the additional parameters.

Updated the unit tests.

Are there any user-facing changes?

There are no breaking changes, but the old functions.window has been marked as deprecated. We can change this if needed because it is currently the only way to use aggregate functions as window functions. That is to be addressed in #833

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants